<?php

namespace app\repository\dao\shop;

use support\Db;

class BrandDao
{
    public static function getList(array &$data): array
    {
        $query = Db::connection('shop')
            ->table('store_brand');

        $count = $query->count();
        $list = $query
            ->offset(($data['page'] - 1) * $data['limit'])
            ->limit($data['limit'])
            ->get()->toArray();
        return [
            'count' => $count,
            'list'  => $list,
        ];
    }
}